package com.spring.test.config;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import org.springframework.core.PriorityOrdered;

//带优先级的BD后置处理器，优先级=99
public class PriorityOrderedBeanDefinitionRegistryPostProcessorTest99 implements BeanDefinitionRegistryPostProcessor ,PriorityOrdered {

	@Override
	public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
		System.out.println("带PriorityOrdered=99的BD后置，postProcessBeanDefinitionRegistry被调用");
	}

	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		System.out.println("带PriorityOrdered=99的BD后置，postProcessBeanFactory被调用");
	}

	@Override
	public int getOrder() {
		return 99;
	}
}

